<?php

declare(strict_types=1);

namespace App\CustHub\Mapper;

use App\CustHub\Model\ChListenContact;
use Hyperf\Database\Model\Builder;
use Mine\Abstracts\AbstractMapper;
use Mine\MineModel;

class ChListenContactMapper extends AbstractMapper
{
    public function assignModel()
    {
        $this->model = ChListenContact::class;
    }


    public function handleSearch(Builder $query, $params): Builder
    {
        if(!empty($params['main_uid'])){
            $query->where('main_uid', $params['main_uid']);
        }
        if(!empty($params['uid'])){
            $query->where('uid', $params['uid']);
        }
        return $query;
    }
}